package com.itdianzi.controller.feedback;

import com.itdianzi.controller.base.BaseController;
import com.itdianzi.domain.system.Dept;
import com.itdianzi.domain.system.User;
import com.itdianzi.service.system.DeptService;
import com.itdianzi.service.system.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/feedback/information")
public class InformationController extends BaseController {
    @Autowired
    private UserService userService;
    @Autowired
    private DeptService deptService;
    @RequestMapping("/list")
    public String list() {
        String id = loginUser.getId();
        //根据ID查询用户信息
        User user = userService.findById(id);

        request.setAttribute("user",user);
        //根据公司ID查询部门信息
        List<Dept> deptList = deptService.findAll(companyId);
        request.setAttribute("deptList",deptList);

        return "feedback/feedback-information";
    }
}
